<%-- 
    Document   : index
    Created on : Apr 2, 2012, 1:14:26 AM
    Author     : Apol
--%>

<%-- Header Area --%>
<%@ include file="/template/header.jsp" %> 
<%-- End of Header Area --%>


<%-- Content Area --%>
<h2>${title}</h2>
<div class="submenu">
    <ul>
        <li><a href="/manage">Manage</a></li>
    </ul>
    <div class="clear"></div>
</div>

<table class="generic-vertical-table">
    <tr>
        <th>Transaction ID</th>
        <th>Account ID</th>
        <th>Address</th>
        <th>Purchased date</th>
        <th>Total amount</th>
        <th>Status</th>
        <th>Action</th>
    </tr>
    <% if (transactions != null && transactions.size() != 0) { %>

    <% for (Transaction t : transactions) {%>
    <tr>
        <td><a href="/account/history/detail?id=<%= t.getTrans_id() %>">#<%= t.getTrans_id() %></a></td>
        <td><%= t.getAccount_id() %></td>
        <td><%= t.getAddress()%></td>
        <td><%= t.getDate_purchased() %></td>
        <td><%= t.getTotal_amount() %></td>
        <td><%= t.getStatus() %></td>
        <td align="center">
            <% if (t.getStatus().equalsIgnoreCase("pending")) { %>
                <a href="/manage/order/update?id=<%= t.getTrans_id()%>&confirm">Approve</a> |
                <a href="/manage/order/update?id=<%= t.getTrans_id()%>&reject">Reject</a>
                <% } else if (t.getStatus().equalsIgnoreCase("on process")) { %>
                <a href="/manage/order/update?id=<%= t.getTrans_id()%>&complete">Complete</a>
                <% } else { %>
                    -
                <% } %>
        </td>
    </tr>
    <% }%>
    <% } else {%>
    <tr>
        <td colspan="7" align="center">
            No pending transaction.
        </td>
    </tr>
    <% }%>
</table>

<%-- Footer Area --%>
<%@ include file="/template/footer.jsp" %>
<%-- End of Footer Area --%>
